﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainFrame.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<GPMS.Model.ProjectPlan>>" %>

<%@ Import Namespace="GPMS.Model" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    计划管理
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        计划管理</h2>
    <pre>
题目名称：<%:(ViewData["gp"] as GraduationProject).GPName %>
类型：<%:(ViewData["gp"] as GraduationProject).Type %>
导师：<%:(ViewData["guider"] as UserInfo).RealName%> <%: Html.ActionLink("发信息","Send","Message",new {id=(ViewData["guider"] as UserInfo).UserID}, new { @class = "dialog" }) %>
学生：<%:ViewData["student"] %>
</pre>
    <%
        var selection = (ViewData["selection"] as GPSelection);
        if (!bool.Parse(ViewData["finish"].ToString()))
        { %>
    <p>
        <%: Html.ActionLink("新建计划", "Create", new { id = selection.SelectionID }, new { @class = "dialog" })%>
        <%: Html.ActionLink("提交答辩", "ReadyForAnswer", new { id = selection.SelectionID }, new { @class = "dialog" })%>
    </p>
    <%}
        else if (selection.GuiderMark != null)
        {%>
    <p>
        答辩结果：</p>
    <p>
        导师评分--<%:selection.GuiderMark %>
    </p>
    <p>
        导师评价--<%:selection.GuiderEvaluation %>
    </p>
    <p>
        组长评分--<%:selection.LeaderMark %></p>
    <p>
        组长评价--<%:selection.LeaderEvaluation %></p>
    <p>
        组员评分--<%:selection.ReviewerMark %></p>
    <p>
        组员评价--<%:selection.ReviewerEvaluation %>
    </p>
    </pre>
    <%}
        else if (bool.Parse(ViewData["isGuider"].ToString()))
        {%>
    <%: Html.ActionLink("评分", "Rating", "GPSelection", new { id = selection.SelectionID }, new { @class = "dialog" })%>
    <%} %>
    <table id="tableplanlist2">
        <tr>
            <th>
                计划内容
            </th>
            <th>
                开始时间
            </th>
            <th>
                结束时间
            </th>
            <th>
                是否完成
            </th>
            <th>
                最终完成时间
            </th>
            <th>
                文件
            </th>
            <th>
                操作
            </th>
        </tr>
        <% foreach (var item in Model)
           { %>
        <tr>
            <td>
                <%: item.Description %>
            </td>
            <td>
                <%: String.Format("{0:d}", item.BeginDate) %>
            </td>
            <td>
                <%: String.Format("{0:d}", item.FinishDate) %>
            </td>
            <td>
                <%if (item.IsDone)
                  {
                      Response.Write("是 ");
                  }
                  else
                  {
                      Response.Write("否");
                  }%>
            </td>
            <td>
                <%: String.Format("{0:g}", item.RealFinishDate) %>
            </td>
            <td>
                <%if (item.FileID != null)
                  {%>
                <%:Html.ActionLink("下载","Download","File",new {id= item.FileID},null) %>
                <%}
                  else
                  {%>
                无
                <%}%>
            </td>
            <td>
                <%if (!item.IsDone)
                  {%>
                <%: Html.ActionLink("修改", "Edit", new { id=item.PlanID}, new { @class = "dialog" })%>
                <%: Html.ActionLink("删除", "Delete", new { id = item.PlanID }, new { @class = "dialog" })%>
                <%: Html.ActionLink("提交文件", "SelectFile", new { id = item.PlanID }, new { @class = "dialog" })%>
                <%: Html.ActionLink("评分", "rating", new { id = item.PlanID }, new { @class = "dialog" })%>
                <%}
                  else
                  {%>
                <pre>
评价:<%:item.Evaluation %>
分数:<%:item.Mark %>
                     </pre>
                <%}%>
            </td>
        </tr>
        <% } %>
    </table>
    <script type="text/javascript">
        $(function () {
            tableToGrid($("#tableplanlist2"), { width: 800, height: 480 });
            InitDialogLink($("a.dialog"), $("#dialogPanel"));
        });
        var reflashTag = {};
    </script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
    <link href="<%=Url.Content("~/Content/css/ui.jqgrid.css") %>" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/i18n/grid.locale-cn.js") %>"></script>
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery.jqGrid.min.js") %>"></script>
    <style type="text/css">
        body
        {
            background: white;
        }
    </style>
</asp:Content>
